function dataOut = extractTrainingData(fname)

	[pointData,intensity] = readbin(fname);

	[~,name] = fileparts(fname);
	name = string(name);
	name = extractBefore(name,'.');
	name = replace(name,'_',' ');

	labelNames = ["4wd","building","bus","car","pedestrian","pillar",...
		    "pole","traffic lights","traffic sign","tree","truck","trunk","ute","van"];

    label = categorical(name,labelNames);

    dataOut = {pointCloud(pointData,'Intensity',intensity),label};

end
